package com.ws.util;

import org.apache.axis.message.MessageElement;

public class TestCase {

	
	public TestCase(){}
	
	
	public String getBalance(String username,String password,String mobile,String contetnt)throws Exception{
		com.ws.util.BS3WebserviceSoap_BindingStub binding;
        try {
            binding = (com.ws.util.BS3WebserviceSoap_BindingStub)
                          new com.ws.util.BS3WebserviceLocator().getBS3WebserviceSoap();
        }
        catch (javax.xml.rpc.ServiceException jre) {
            if(jre.getLinkedCause()!=null)
                jre.getLinkedCause().printStackTrace();
            throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
        }

        // Time out after a minute

        // Test operation
        com.ws.util.SendSMSResponseSendSMSResult value =  binding.sendSMS(username,password,"","","",mobile,contetnt);
        if(value==null){
        	return null;
        }else{
        	MessageElement[] messages=value.get_any();
        	if(messages!=null || messages.length>=1){
        		MessageElement xml= messages[0];
        		return xml.toString();
        	}else{
        		return null;
        	}
        }
        
       	}
	
	public static void main(String[] args) throws Exception{
		TestCase testCase=new TestCase();
		//System.out.println(testCase.getBalance("ceshiZLJ","888zhanglijie!@#"));
//		System.out.println(testCase.getBalance("hyzy","123456"));

	}
}
